/*
* Copyright 2016 Yonyou Auto Information Technology（Shanghai） Co., Ltd. All Rights Reserved.
*
* This software is published under the terms of the YONYOU Software
* License version 1.0, a copy of which has been included with this
* distribution in the LICENSE.txt file.
*
* @Project Name : marketing-wechat-open-api
*
* @File name : SimulationAttentionController.java
*
* @Author : LiuJun
*
* @Date : 2016年12月7日
*
----------------------------------------------------------------------------------
*     Date       Who       Version     Comments
* 1. 2016年12月7日    LiuJun    1.0
*
*
*
*
----------------------------------------------------------------------------------
*/
	
package com.yonyou.gmcc.gateway.wechat.controller.common;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.marketing.common.constants.CookieConstant;
import org.marketing.common.util.CookieSecurityUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.yonyou.gmcc.gateway.wechat.common.ApiVersionConsts;

/**
*
* @author LiuJun
* TODO description
* @date 2016年12月7日
*/
@RestController
@RequestMapping(value = ApiVersionConsts.BASE_PATH+"/attention")
public class SimulationAttentionController {
    
    @RequestMapping(method =  RequestMethod.GET)
    public void simulationLogin(HttpServletResponse response, HttpServletRequest request) throws Exception {
        Cookie cookieDealerCode = new Cookie(CookieConstant.WECHAT_COOKIE_DEALERCODE, CookieSecurityUtil.encrypt("270001"));
        Cookie cookieDealerAppId = new Cookie(CookieConstant.WECHAT_COOKIE_DEALER_APPID, CookieSecurityUtil.encrypt("1231234124"));
        cookieDealerCode.setPath("/");
        cookieDealerAppId.setPath("/");
        response.addCookie(cookieDealerCode);
        response.addCookie(cookieDealerAppId);
    }

}
